import WatchBlock from '../src/utils/WatchBlock';

const a: WatchBlock = new WatchBlock("a", {
    Position: "relative",
    Left: 500,
    Top: 500,
    Padding: 50,
    Childrens: [
        new WatchBlock("b", {
            Padding: 20,
            Childrens: [
                new WatchBlock("h", {
                    Width: 450,
                    Height: 300,
                    Padding: 18,
                }),
                new WatchBlock("i", {
                    Width: 420,
                    Height: 500,
                    Padding: 8,
                }),
            ]
        }),
        new WatchBlock("c", {
            Position: "absolute",
            Left: 20,
            Right: 20,
            Top: 20,
            Bottom: 20,
            Padding: 10,
            Childrens: [
                new WatchBlock("e", {
                    Width: 172,
                    Height: 156,
                    Padding: 22,
                }),
                new WatchBlock("f", {
                    Flex: 1,
                    Padding: 17,
                }),
                new WatchBlock("g", {
                    Flex: 3,
                    Padding: 11,
                }),
            ]
        }),
        new WatchBlock("d", {
            Width: 450,
            Height: 320,
            Padding: 40,
        })
    ]
});

a.CalcUi();

const logBlock = function (block: WatchBlock) {
    console.log(block.Name, block.Content.Left.Value, block.Content.Top.Value, block.Content.Width.Value, block.Content.Height.Value);
    block.Childrens.forEach(child => { logBlock(child) });
};
logBlock(a);